database = [['albert', '1234'],
            ['dilbert', '4242'],
            ['smith', '7524'],
            ['jones', '9843']]



username='scuec', password='2345'
  Cell In[13], line 1
    username='scuec', password='2345'
    ^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?


['jones', '9843'] in database
Out[14]: True

database = [['albert', '1234'],
            ['dilbert', '4242'],
            ['smith', '7524'],
            ['jones', '9843']]

['jones', '9843'] in database
Out[15]: True

db=database

db[2]
Out[17]: ['smith', '7524']

db[2][0]='SMITH'

db
Out[19]: [['albert', '1234'], ['dilbert', '4242'], ['SMITH', '7524'], ['jones', '9843']]

db[2][1]='1111'

db
Out[21]: [['albert', '1234'], ['dilbert', '4242'], ['SMITH', '1111'], ['jones', '9843']]

new=['tom','8888']

db.append(new)

dn
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[24], line 1
----> 1 dn

NameError: name 'dn' is not defined

db
Out[25]: 
[['albert', '1234'],
 ['dilbert', '4242'],
 ['SMITH', '1111'],
 ['jones', '9843'],
 ['tom', '8888']]

new=['alice','1111']

db.insert(0,new)

db
Out[28]: 
[['alice', '1111'],
 ['albert', '1234'],
 ['dilbert', '4242'],
 ['SMITH', '1111'],
 ['jones', '9843'],
 ['tom', '8888']]

del db[1]

db
Out[30]: 
[['alice', '1111'],
 ['dilbert', '4242'],
 ['SMITH', '1111'],
 ['jones', '9843'],
 ['tom', '8888']]

sorted(db,reverse=True)
Out[31]: 
[['tom', '8888'],
 ['jones', '9843'],
 ['dilbert', '4242'],
 ['alice', '1111'],
 ['SMITH', '1111']]

db
Out[32]: 
[['alice', '1111'],
 ['dilbert', '4242'],
 ['SMITH', '1111'],
 ['jones', '9843'],
 ['tom', '8888']]

db.sort()

db
Out[34]: 
[['SMITH', '1111'],
 ['alice', '1111'],
 ['dilbert', '4242'],
 ['jones', '9843'],
 ['tom', '8888']]

for each in db
  Cell In[35], line 1
    for each in db
                  ^
SyntaxError: expected ':'


for each in db:
    print(each)
    
['SMITH', '1111']
['alice', '1111']
['dilbert', '4242']
['jones', '9843']
['tom', '8888']

for each in db:
    print([each[0].upper(),each[1])
  Cell In[37], line 2
    print([each[0].upper(),each[1])
                                  ^
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['


for each in db:
  Cell In[38], line 1
    for each in db:
                   ^
_IncompleteInputError: incomplete input


print([each[0].upper(),each[1]])
['TOM', '8888']

for each in db:
  print([each[0].upper(),each[1]])  
  
['SMITH', '1111']
['ALICE', '1111']
['DILBERT', '4242']
['JONES', '9843']
['TOM', '8888']

new_db.append([each[0].upper(),each[1]])
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[41], line 1
----> 1 new_db.append([each[0].upper(),each[1]])

NameError: name 'new_db' is not defined

for each in db:
  print([each[0].upper(),each[1]])
  new_db.append([each[0].upper(),each[1]])
  
['SMITH', '1111']
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[42], line 3
      1 for each in db:
      2   print([each[0].upper(),each[1]])
----> 3   new_db.append([each[0].upper(),each[1]])

NameError: name 'new_db' is not defined

new.db=[]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[43], line 1
----> 1 new.db=[]

AttributeError: 'list' object has no attribute 'db' and no __dict__ for setting new attributes

new_db=[]

 for each in db:
2   print([each[0].upper(),each[1]])
----> 3   new_db.append([each[0].upper(),each[1]])
  Cell In[45], line 2
    2   print([each[0].upper(),each[1]])
    ^
IndentationError: expected an indented block after 'for' statement on line 1


for each in db:
    print([each[0].upper(),each[1]])
    new_db.append([each[0].upper(),each[1]])
    
['SMITH', '1111']
['ALICE', '1111']
['DILBERT', '4242']
['JONES', '9843']
['TOM', '8888']